from config import BASE_URL
from page.page_limit import LimitPage
from page.page_login import LoginPage
from script import log
from tools import DriverTools


class TestLimit(object):
    def setup_method(self):
        driver = DriverTools.get_driver()
        driver.get(BASE_URL+"/common/member/login")
        self.log = LoginPage(driver)
        self.lim = LimitPage(driver)

    def teardown_method(self):
        DriverTools.quit_driver()

    def test01_limit_success(self):
        self.log.login("18683060005", "abc123")
        self.lim.limit("10000","测试额度申请","8888")
        result = self.lim.get_success_result()
        print(result)
        log.info(f"执行结果：{result}")

        assert "待审核" in result
        self.lim.get_shot("limit_success.png")

